<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<s:if test="hasFieldErrors()">
		<div>
			用s:fielderror输出一个字段的错误信息：
			<s:fielderror fieldName="user.username" />
			<br />用s:fielderror输出所有字段的错误信息：
			<s:fielderror />
		</div>
	</s:if>
	<s:if test="hasActionErrors()">
		<div>
			用s：actionerror输出所有Action错误信息：
			<s:actionerror />
		</div>
	</s:if>
	<h3>直接在execute方法里做判断</h3>
	<s:form action="userAction" method="post" namespace="/">
		<s:textfield name="user.username" label="用户名" />
		<s:password name="user.password" label="密码" />
		<s:textfield name="user.age" label="年龄" />
		<s:textfield name="user.email" label="邮箱" />
		<s:submit value="提交" />
	</s:form>
	<s:debug />
</body>
</html>